<?php
/**
 * Joomla! 1.5 component ArticleCashRewards
 *
 * @version $Id: view.html.php 2009-05-10 01:47:01 svn $
 * @author Maverick
 * @package views.pendingpayments
 * @subpackage ArticleCashRewards
 * @license GNU/GPL
 * Website: http://www.boddunan.com
 *
 * Review and approve the articles and assign points and cash rewards.
 * Users can see their articles and the points/cash rewards assigned in the front-end module.
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

// Import Joomla! libraries
jimport( 'joomla.application.component.view');
class ArticleCashRewardsViewAwards extends JView {
	
    function display($tpl = null) {

		JToolBarHelper::custom('cpanel', 'default.png', 'default.png', JText::_('TITLE_CPANEL'), false);

        $model = $this->getModel('awards');
        
		if($this->getLayout() == 'form') {
            
            JToolBarHelper::save();
            JToolBarHelper::title("&nbsp;&nbsp;&nbsp;&nbsp;" . JText::_('ArticleCashRewards').': <small><small>[ ' . JText::_('PAGE_MAKE_ADHOC_PAY') .' ]</small></small>', 'acr-48.png');
            
            $pay_types 	=& $model->getAdhocPaymentTypes(false);
            $payment 	=& $model->getAdhocPaymentMade();
            $params     = JComponentHelper::getParams('com_articlecashrewards');

            $this->assignRef('pay_types', $pay_types->rows);
            $this->assignRef('payment', $payment);
            $this->assignRef('params', $params);
		}else  if($this->getLayout() == 'manage') {

            JToolBarHelper::title("&nbsp;&nbsp;&nbsp;&nbsp;" . JText::_('ArticleCashRewards').': <small><small>[ ' . JText::_('PAGE_MANAGE_PAYMENT_TYPES') .' ]</small></small>', 'acr-48.png');
            JToolBarHelper::publishList();
            JToolBarHelper::unpublishList();
            JToolBarHelper::deleteList();
            JToolBarHelper ::custom( 'save_type', 'save.png', 'save.png', 'Save', false, false );

            $pagination =& $model->getPagination();
            $types 	=& $model->getAdhocPaymentTypes(true);
            $params 	= JComponentHelper::getParams('com_articlecashrewards');

            $this->assignRef('result', $types);
            $this->assignRef('pagination', $pagination);
            $this->assignRef('params', $params);
		}else  if($this->getLayout() == 'list') {
            JToolBarHelper::title("&nbsp;&nbsp;&nbsp;&nbsp;" . JText::_('ArticleCashRewards').': <small><small>[ ' . JText::_('PAGE_LIST_ADHOC_PAYMENTS') .' ]</small></small>', 'acr-48.png');
            $pagination =& $model->getPagination();
            $result 	=& $model->getAdhocPaymentsMade();
            $params 	= JComponentHelper::getParams('com_articlecashrewards');

            $this->assignRef('rows', $result->rows);
            $this->assignRef('lists', $result->lists);
            $this->assignRef('pagination', $pagination);
            $this->assignRef('params', $params);
		}else{
            
        }

        parent::display($tpl);
    }
}
?>